import {
  defineStore
} from 'pinia';
  
import storeAaa from "./aaa";

export default defineStore('user', {
  state: () => ({
    count: 10,
    username: '10个肉包子'
  }),
  getters: {
    countGetter: (state) => state.count + '个'
  },

  // 支持异步
  actions: {
    async changeCount () {
      console.log('changeCount');
      let aaa = storeAaa()
      // if (aaa.a) {
      //   console.log('aaa', aaa);
      // } else {
      //   throw new Error('User must be authenticated')
      // }
      this.count++
    }
  },
});